<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
				table{width:1200px; border-collapse:collapse;
					text-align:center;
					margin: 0 auto;
					table-layout: fixed;
				}
				td{border:1px solid #ccc}
				thead td{font-weight:bold;}
		</style>
	</head>
	<body>
		<script src="../jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var arr = [{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				},
				{
					"name": "金辉",
					"age": "18",
					"salary": "3500"
				},
				{
					"name": "马青云",
					"age": "20",
					"salary": "5500"
				},
				{
					"name": "公寓",
					"age": "19",
					"salary": "4500"
				}
			];
			//表头
			var table=$("<table></table>");
			var tr=$("<tr></tr>");
			var title=["姓名","年龄","工资"];
			for(var i=0;i<title.length;i++){
				tr.append($(`<td>${title[i]}</td>`));
			}
			table.append(tr);
			
			//数据
			arr.forEach(val=>{
				var tr=$("<tr></tr>");
				for(var i in val){
					tr.append($(`<td>${val[i]}</td>`));					
				}
				table.append(tr);
			})
			$("body").append(table);
			
		</script>
	</body>
</html>
